//
//  YJCategoryView.m
//  SnackCourier
//
//  Created by qianfeng01 on 15/7/23.
//  Copyright (c) 2015年 qianfeng01. All rights reserved.
//

#import "CategoryView.h"
#import "UIImageView+WebCache.h"

@interface CategoryView ()

@property (nonatomic,weak)id target;
@property (nonatomic,assign)SEL action;

@end

@implementation CategoryView


-(void)addTarget:(id)target action:(SEL)action{
    self.target =target;
    self.action =action;
}

-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
    
    if ([self.target respondsToSelector:self.action]) {
        [self.target performSelector:self.action withObject:self];
    }
#pragma clang diagnostic pop
}

-(void)showWithDataModel:(YJCategoryModel *)model{
    [self.smallImgUrlView sd_setImageWithURL:[NSURL URLWithString:model.smallImgUrl]];
    self.cateNameLabel.text =model.cateName;
}







@end
